import React from 'react';
import Modal from 'antd-mobile/lib/modal'
import './index.less';

const warn = require('src/static/care-su.png');

export default class Order extends React.PureComponent {

  state = {
    show:this.props.show
  }

  toCart = () => {
    this.setState({ show: false });
    __self.history.push('/cart')
  }

  render() {
    const { show } = this.state;
    return (
      <Modal
        visible={show}
        transparent
        onClose={()=>{this.setState({show:false})}}
        closable
        className="care-modal-am"
      >
        <div className="care-modal">
          <img src={warn} alt="" />
          <div>
            <div>成功加入购物车！</div>
            <div><span>您可以</span><span className="to-cart" onClick={this.toCart}>去购物车结算&gt;</span></div>
          </div>
        </div>
      </Modal>
    )
  }
}